﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Xml;
using System.Reflection;


namespace MapSurface.UIModelElement
{
    public class ChoiceTable
    {
        private string _uimodel;

        public string Uimodel
        {
            get { return _uimodel; }
            set { _uimodel = value; }
        }
        private List<FUIElement> _fuiElement;

        public List<FUIElement> FuiElement
        {
            get { return _fuiElement; }
            set { _fuiElement = value; }
        }

        public ChoiceTable(string uiModelName)
        {
            _uimodel = uiModelName;
        }
    }
    public class FUIElement
    {
        private string _widgetType;

        public string WidgetType
        {
          get {
              if (_widgetType.Contains(":"))
                  return _widgetType.Substring(2);
              return _widgetType; 
          }
          set { _widgetType = value; }
        }
        private string _name;

        public string Name
        {
          get { return _name; }
          set { _name = value; }
        }
        private List<Equivalent> equivalents;

        public List<Equivalent> Equivalents
        {
            get { return equivalents; }
            set { equivalents = value; }
        }

        private UIElement uielement;

        public UIElement UIelement
        {
            get { return uielement; }
            set { uielement = value; }
        }

        public FUIElement(string name, string widgetType, UIElement element)
        {
            _name = name;
            _widgetType = widgetType;
            UIelement = element;
        }
    }
    public class Equivalent
    {
        private string _widgetType;

        private UIElement uielement;
       
        public UIElement UIelement
        {
            get { return uielement; }
            set { uielement = value; }
        }


        public string WidgetType
        {
          get {
              if (_widgetType.Contains(":"))
                  return _widgetType.Substring(2);
              return _widgetType; 
          }
          set { _widgetType = value; }
        }
        private string _name;

        public string Name
        {
          get { return _name; }
          set { _name = value; }
        }

        public Equivalent(string name, string widget, UIElement element)
        {
            _widgetType = widget;
            _name = name;
            UIelement = element;
        }
        public object instance = null;

    }
 }
